Python wrapper for Jupyter Notebooks Public API#121
Conversation
|
This pull request has been linked to Clubhouse Story #56395: Public API to list / get Jupyter notebooks. |
dataikuapi/dss/notebook.py
Outdated
| """ | ||
| if self.state is None: | ||
| self.state = self.client._perform_json("GET", "/projects/%s/notebooks/" % self.project_key, params={'notebookName' : self.notebook_name}) | ||
| notebook_list = self.client._perform_json("GET", |
There was a problem hiding this comment.
Should we keep the cache mechanism?
(If you put back the cache, maybe you should add with an optional parameter clear_cache = false for when the user know the cache is wrong. Or a clear_cache() method)
dataikuapi/dss/notebook.py
Outdated
| """ | ||
| if self.state is None: | ||
| self.state = self.client._perform_json("GET", "/projects/%s/notebooks/" % self.project_key, params={'notebookName' : self.notebook_name}) | ||
| notebook_list = self.client._perform_json("GET", |
There was a problem hiding this comment.
This variable contains the metadata of the notebook, not a notebook.
The java object is names JupyterNotebookListItem which is super confusing so maybe let's not use that.
Maybe something like:
| notebook_list = self.client._perform_json("GET", | |
| notebook_states = self.client._perform_json("GET", |
dataikuapi/dss/notebook.py
Outdated
|
|
||
| def get_state(self): | ||
| """ | ||
| Get the status of the notebook |
There was a problem hiding this comment.
This is (and was) not compatible with SQL notebooks
| Get the status of the notebook | |
| Get the status of the Jupyter notebook |
|
⬆️ I created a new PR based on the suggested changes to add an endpoint for sessions and return the object on create/update |
* Use new sessions endpoint in get_sessions call * Put back cache for state with a refresh parameter to get the state directly from backend * Return created notebook as object
Story details : [ch56395]